import TemplateManager from '@/views/templateManager';
import EditSheet from '@/views/editeSheet';
import {
    VideoCameraOutlined,
    SettingOutlined
} from '@ant-design/icons';


export const routersConfig = [
    // {
    //     key: '/',
    //     component: TemplateManager, 
    //     icon: <VideoCameraOutlined />,
    //     label: '模版管理',
    //     showInMenuList: false,
    //     showMenu:true,
    // },
    {
        key: '/easy_sheet/templateManager',
        component: TemplateManager, 
        icon: <SettingOutlined />,
        label: '模版管理',
        showInMenuList: true,
        showMenu:true,
        showHeader:true
    },
    {
        key: '/easy_sheet/editeSheet',
        component: EditSheet, 
        icon: <VideoCameraOutlined />,
        label: '数据填报',
        showInMenuList: false,
        showMenu:false,
        showHeader:false
    }
]

export const getRouteConfig = path => { 
    // @ts-ignore
    const p = path || '/'
    let config = null
    routersConfig.forEach(routerConfig => { 
        if (routerConfig.key === p || p.includes(routerConfig.key)) { 
            config =  routerConfig
        }
    })
    return config
}